package com.flyan.danmuhunter.bilibili.data;

import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import lombok.experimental.Accessors;

import static com.flyan.danmuhunter.common.utils.Helper._null;

/**
 * 用户信息
 *
 * @author flyan
 * @version 1.0
 * @date 2022/6/8
 */
@Data
@Accessors(chain = true)
public class UserInfo {

    /**
     * uid
     */
    private Long uid;

    /**
     * 用户名
     */
    private String uname;

    /**
     * 等级
     */
    private Integer level;

    public UserInfo(JSONArray userInfo) {
        if(_null(userInfo)) {
            return;
        }

        this.uid = userInfo.getLong(0);
        this.uname = userInfo.getString(0);
    }
}
